package com.vm.activity;

import java.util.List;

import com.vm.adapter.DownloadingAdapter;
import com.vm.db.DownInfoDao;
import com.vm.model.ActiveSoft;
import com.vm.model.DownInfo;
import com.vm.myview.ViewDownUtils;
import com.vm.myview.ViewUtils;
import com.wwt.app.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ListView;

/**
 * 
 * @ProjectName: [WeiMai]
 * @Author: [kent.wang]
 * @CreateDate: [2015年2月4日 下午3:40:30]
 * @Version: [v1.0]
 * 
 */
public class DownloadingActivity extends Activity {

	ListView lv_downloading;
	DownInfoDao infoDao;
	ViewDownUtils viewDownUtils;
	ActiveSoft activeSoft;
	LinearLayout found_ll_1;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.downloading);

		init();
		infoDao = new DownInfoDao(this);
		viewDownUtils = new ViewDownUtils(this, this);
		List<DownInfo> list = infoDao.getDownloading();
		
		int i = 0;
		for (DownInfo downInfo : list) {
			activeSoft = new ActiveSoft();
			activeSoft.setSoftId(downInfo.getSoftId());
			activeSoft.setName(downInfo.getName());
			activeSoft.setImageUrl(downInfo.getImageUrl());
			found_ll_1.addView(viewDownUtils.dyAddView(i, activeSoft,1));
			i++;
		}
	}

	public void init() {
		found_ll_1 = (LinearLayout) findViewById(R.id.found_ll_1);
	}
}
